<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<!DOCTYPE html>
<html>
<head>
    <title>账户信息</title>
    <%@ include file="/WEB-INF/component/commonCSS.jsp"%>
    <style type="text/css">
        div.group-info {
            margin-top: 10px !important;
            margin-bottom: 0px !important;
        }
        input.innerInput {
            width: 98%;
        }
    </style>
</head>
<body class="skin-blue sidebar-mini fixed skin-blue-light-frame">
    <section class="content-header">
        <h1>医疗机构账户管理</h1>
        <ol class="breadcrumb">
            <li><a href="${ctx}/home.jsp"><i class="fa fa-home"></i>首页</a></li>
            <li class="active"><a href="#">账户管理</a></li>
            <li class="active"><a href="#">医疗机构账户管理</a></li>
        </ol>
     </section>
    <section class="content">
        <div class=" box box-success">
            <div class="box-body">
                <div class=" form-inline">
        
                   <div class="form-group form-group-xs">
                                             机构编码： <input class="form-control" type="text" id="orgCode" name="orgCode" placeholder="机构编码" />
                   </div>
                   <div class="form-group form-group-xs">
                                            机构名称： <input class="form-control" type="text" id="orgName"  name="orgName" placeholder="机构名称" />
                   </div>
                    
                   <button type="button" onclick="gridSerch();" class="btn btn-success btn-sm">查询</button>
                    
                </div>
            </div>
        </div>
        
        <table class="jqgrid" id="gridlist"></table>
        <div id="gridpage"></div>
        
        <form action="toAuditHospBankAcctList.html" method="post" id="BankForm">
            <input type="hidden" id="orgId" name="orgId">
            <input type="hidden" id="orgType" name="orgType" value="4">
        </form>
        
        <form action="toAuditHospBankAcctTransList.html" method="post" id="BankAcctForm">
            <input type="hidden" id="BankOrgId" name="orgId">
            <input type="hidden" id="orgType" name="orgType" value="4">
        </form>
   </section>
    
   <%@ include file="/WEB-INF/component/commonJS.jsp"%>
   <script type="text/javascript">
        $(function() {
            $("#gridlist").jqGrid(
                    {   url : "getAuditHospAcctList.html",
                        mtype : "POST",
                        datatype : "json",
                        autowidth : true,
                        height : 255,
                        colNames : [ '账户id','机构编号','机构名称 ','机构类型 ','余额 ','可用余额','待结算金额','操作 '],
                        colModel : [
                                    {name : 'orgId',index : 'orgId',hidden : true , width : 100,align : "center"},
                                    {name : 'orgCode',index : 'orgCode',width : 120,align : "center"},  
                                    {name : 'orgName',index : 'orgName',width : 160,align : "left"}, 
                                    {name : 'orgType',index : 'orgType',width : 100,hidden:true,align : "center"},
                                    {name : 'outstandAmt',index : 'outstandAmtStr',width : 100,align : "right"},
                                    {name : 'availableAmt',index : 'availableAmtStr',width : 100,align : "right",summaryType : 'sum'},
                                    {name : 'pendingAmt',index : 'pendingAmtStr',width : 100,align : "right"},
                                    {name : 'order',index : 'order',width : 160,align : "center",
                                        formatter:function(val, opts,
                                                rowdata) {
                                            var str="<a href='javaScript:bankLook(\""+rowdata.orgId+"\")'>银行账户信息查看</a>"
                                                +"<a href='javaScript:bankAcctLook(\""+rowdata.orgId+"\")'>交易明细查看</a>";
                                            return str
                                        }
                                    }
                        ],
                        rowNum : 20,
                        rowList : [ 10, 20, 50,100],
                        rownumbers : true,
                        pager : "#gridpage",
                        //multiselect: true, 
                        viewrecords : true,
                        caption : "医疗机构账户列表",
                        jsonReader : {
                            repeatitems : false,
                            id : "ids"
                        }
                    });
            $("#gridlist").jqGrid('navGrid', '#gridpage', {add : false,edit : false,del : false,search : false,refresh : false});
            $(window).trigger("resize");
        });
               function getFoucs(obj, rowId) {
                   var text = $.trim($(obj).val());
                   if (text != null && text != "") {
                       var $checkbox = $("#jqg_gridlist_" + rowId);
                       if ($checkbox.is(":not(:checked)")) {
                           $("#gridlist").setSelection(rowId);
                       }
                   }
               }
               
               //查询
               function gridSerch() {
                   var orgCode = $.trim($("#orgCode").val());
                   var orgName = $.trim($("#orgName").val());
                   $("#gridlist").jqGrid('setGridParam',{  
                       datatype:'json',
                       postData:{
                           "orgCode":orgCode,
                           "orgName":orgName
                       },
                       page:1
                   }).trigger("reloadGrid"); //重新载入  
               }
               
               //查看银行账户信息
                 function bankLook(id) {
                   $("#orgId").val(id);
                   $("#BankForm").submit();
                 }
                    
               
               //查看交易明细
               function bankAcctLook(id){
                   $("#BankOrgId").val(id);
                   $("#BankAcctForm").submit();
               }
    </script>
</body>
</html>